#include <stdio.h>

int main()
{
	int a[4][4];
	for ( int i = 0; i < 4; i++ ) {
		for ( int j = 0; j < 4; j++ ) {
			scanf("%d", &a[i][j]);
		}
	}
	
	int sum1 = 0, sum2 = 0;
	for ( int i = 0; i < 4; i++ )
	{
		sum1 += a[i][i];
		sum2 += a[i][3-i];
	}
	printf("%d %d", sum1, sum2);
	return 0;
}
